Create Content
The endpoint is used to generate Single Image and Carousel posts using Model Version 4, and Video posts.
Model Version 2 is deprecated and can no longer be used to generate single images or carousels. Single image and carousel requests with model_version set to 2 are rejected with HTTP status code 400 and the error below. Please use Model Version 4 instead. If you omit model_version, Model Version 4 is used by default.
{
"errors": [{
"field": "model_version",
"detail": "Model Version 2 is deprecated. Please use Model Version 4 instead.",
"solution": "Pass model_version as 4 or omit the model_version field (it defaults to 4). See documentation: https://predis.ai/developers/"
}]
}
Videos are not affected: media_type video keeps working with video_duration, template_ids, media_urls and headlines, and model_version is ignored for videos. For single images and carousels, the meme and quotes post types, template_ids, media_urls and headlines are no longer supported, and requests that include them are rejected with HTTP status code 400. The Get Templates endpoint now lists video templates only.
Request URL
- POST https://brain.predis.ai/predis_api/v1/create_content/
Request Payload
Note - Please use "Payload Type" as form-data when you calling this API.
| Name | Description | Type | Default Value | Possible Values | Required |
|---|---|---|---|---|---|
brand_id | Unique Identifier of your Brand. You can learn more about locating your Brand ID by visiting the link provided here. | String | None | YOUR_BRAND_ID | Yes |
text | Provide the topic for which you intend to create the post. Make sure the topic is at least 20 characters long and consists of a minimum of 3 words to ensure accurate output. | String | None | Any String | Yes |
model_version | Specify the version of the model to use for single images and carousels. Only version 4 is supported. Version 2 is deprecated and single image or carousel requests using it will be rejected. Ignored when media_type is video. | String | 4 | 4 | No |
n_posts | Specify the number of posts you want to generate in a single request. | Integer | 1 | 1 to 10 | No |
input_language | Choose the language for your input text field. | String | english | malay, chinese (traditional), croatian, english, dutch, indonesian, vietnamese, portuguese_br, finnish, french, german, italian, norwegian, polish, romanian, czech, spanish, swedish, turkish, danish, hungarian | No |
output_language | Choose the language in which you want to generate the post. | String | english | malay, chinese (traditional), croatian, english, dutch, indonesian, vietnamese, portuguese_br, finnish, french, german, italian, norwegian, polish, romanian, czech, spanish, swedish, turkish, danish, hungarian | No |
media_type | Specify the type of media you want to generate.single_image and carousel are made with Model Version 4. video is made with the video engine, whatever model_version is set to. | String | single_image | single_image, carousel, video | No |
video_duration | Specify the type of your video. This field is not required when template_ids are selected. However, it is required when the media_type value is set to video. | String | short | short, long | No |
template_ids | Provide this information only when you want your video to be generated using specific video templates. List them with the Get Templates API. You can provide a list of template IDs in the following format: Sample 1: ["template_id1"]Sample 2: ["template_id1", "template_id2", "template_id3"]Supported only when media_type is video | List of strings | [] | [] | No |
media_urls | Provide a list of URLs for images/videos that you want to use in your video. Here are two sample formats: Sample 1: ["url1"]Sample 2: ["url1", "url2", "url3"]Supported only when media_type is video | List of strings | [] | [] | No |
headlines | Provide this input when you wish to override the AI-generated text in the generated video. Supported only when media_type is video | List | None | No | |
color_palette_type | Choose the color palette in which you would like your content to be generated. If you have specified palette as brand but haven't set the brand colors, the content will be automatically generated using the ai_suggested palette. | String | ai_suggested | brand, ai_suggested | No |
brand_details | Provide brand details to make sure AI generates content in the given brand details only. | Dictionary | None | Please check Example here | No |
Sample Success Response
{
"post_ids": [
"..."
],
"post_status": "inProgress",
"errors": [{"..."}]
}
Sample Error Response
{
"errors": [{
"detail": "...",
"solution": "..."
}]
}
Response Codes
| HTTP Status Code | Error Code | User Message | Recommended solution |
|---|---|---|---|
| 429 | 001 | Maximum number of requests reached | Maximum number of hourly requests reached You have been rate-limited. Wait for sometime and try again |
| 400 | 002 | Invalid brand_id provided | You have provided an invalid brand_id. Please provide a valid brand_id and try again. Read more here |
| 400 | 003 | You have reached your post generation limit | You have exhausted the credits available in your plan. Please upgrade to a higher plan or wait until the limit resets |
| 400 | 004 | You have reached the maximum number of posts inProgress | Please wait until the posts in progress gets completed and then try again |
| 400 | 005 | Your request method is invalid | Please make a POST request and then try again |
| 400 | 006 | Your provided text is too small | The provided text should contain atleast 3 words and 20 characters for best results |
| 400 | 007 | The provided value for the media_type field is not valid | Make sure the value is one of single_image, carousel or video |
| 400 | 008 | The provided value for the input_language or output_language field is not valid | Make sure the passed value is supported. Please check the Request Parameters in the above table for more details |
| 400 | 009 | The provided value for the video_duration field is not valid | Make sure the value is either short or long |
| 400 | - | Model Version 2 is deprecated. Please use Model Version 4 instead. | Pass model_version as 4 or omit the model_version field (it defaults to 4) |
| 400 | - | The provided model_version is not supported | Only model_version 4 is supported |
| 400 | - | model_version 4 is not available on your plan | Please upgrade your plan to generate content via the API |
Rate Limiting
Standard API rate limits apply to this endpoint. Read more about the rate limits here